<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>

<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'add.jsp' starting page</title>
    
   	<link href="<%=request.getContextPath() %>/css/add.css" type="text/css" rel="stylesheet">
  </head>
  
  <body>
  	<div id="up">
	   <ul>
	    	<li><span><a href="#">用户管理 </a>&gt; 用户修改 &gt;</span></li>
	   </ul>
	</div>
	<div id="down">
	    <form method="post" action="/user/updateUser">
			<input type="hidden" name="id" value="${user.id}">
	   		<table width="800px">
	   			<tr>
	   				<td>用户名称：</td>
	   				<td><input type="text" name="name" value="${user.name}" readonly class="in"/><span id="mySpan"></span></td>
	   			</tr>
	   			<tr>
	   				<td>用户密码：</td>
	   				<td><input type="text" name="password" value="${user.password}" class="in"/></td>
	   			</tr>
	   			<tr>
	   				<td>年龄：</td>
	   				<td><input type="number" name="age" value="${user.age}" class="in"/></td>
	   			</tr>
				<tr>
					<td>生日：</td>
					<td><input type="date" name="birthday" value="<fmt:formatDate value='${user.birthday}' pattern='yyyy-MM-dd'/>" class="in"/></td>
				</tr>

	   			<tr>
	   				<td>用户角色</td>
	   				<td>
	   					<select name="rid" class="in">
							<c:forEach items="${list}" var="role">
								<option value="${role.rid}" <c:if test="${role.rid==user.rid}">selected="selected"</c:if>>${role.roleName}</option>
							</c:forEach>
	   					</select>
	   				</td>
	   			</tr>
	   			
	   			<tr>
	   				<td></td>
	   				<td>
	   					<input type="submit" value="提&nbsp;&nbsp;&nbsp;交" class="su">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
	   					<input type="reset" value="清&nbsp;&nbsp;&nbsp;空" class="su">
	   				</td>
	   			</tr>
	   		</table>
	    </form>
    </div>
  </body>
</html>
